package com.coolzeng.service.impl;

import com.coolzeng.dao.ReplyMapper;
import com.coolzeng.entity.Reply;
import com.coolzeng.service.ReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/6/11.
 */
@Service
public class ReplyServiceImpl implements ReplyService {
    @Autowired
    private ReplyMapper replyMapper;

    @Override
    public Reply getReply(int id) {

        return replyMapper.selectByPrimaryKey(id);
    }

    @Override
    public List getReplysByPostId(int replyPostId) {

        return replyMapper.selectReplysBypostId(replyPostId);
    }

    @Override
    public void addReply(Reply newreply) {
        replyMapper.insert(newreply);
    }
}
